﻿/*
 * Name:        Input
 * Description: Handles input
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Gyvate.Util;

namespace Gyvate.InputNS
{
    public enum Input_T
    {
        IN_UP = 1,
        IN_DOWN,
        IN_LEFT,
        IN_RIGHT
    }

    public class Input
    {
        private int m_iCurrentInput;

        public int GetCurrentInput() { return m_iCurrentInput; }

        /*
         * Constructor
         */
        public Input()
        {
            m_iCurrentInput = 0;
        }

        /*
         * Adds an input
         * Parameters:
         *      input - bit to add
         */
        public void AddInput(Input_T input)
        {
            BitWiseOperator.AddBit(ref m_iCurrentInput, (int)input);
        }

        /*
         * Removes an input
         * Parameters:
         *      input - bit to remove
         */
        public void RemoveInput(Input_T input)
        {
            BitWiseOperator.RemoveBit(ref m_iCurrentInput, (int)input);
        }

        public int GetLastInput() { return m_iCurrentInput; }
        public void OverrideInput(int newInput) { m_iCurrentInput = newInput; }
    }
}
